check accessability of the file

39

print(os.access('sample.txt', os.R_OK))
# Output False
f = open("sample.txt", "x") #create the file
#check again
print(os.access('sample.txt', os.R_OK))
# Output True

Comments

Submit
0 Comments